package com.xbxkj.api.app.mini.controller;

import com.xbxkj.api.app.mini.entity.MiniAppConst;
import com.xbxkj.commen.bean.ShopExamine;
import com.xbxkj.commen.bean.UserAddress;
import com.xbxkj.commen.controller.model.ResultModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 张子艺
 * @packge com.xbxkj.api.app.mini.controller
 * @data 2020-01-09 17:06
 * @project HuaZhouDelivery
 */
@RequestMapping("/app/mini/{appid}/admin/shopExamine")
@Slf4j
@RestController
@Api( tags="小程序端 商家审核提交相关")
public class ShopExamineController extends  MiniAppBaseController{

    /** 添加门店申请
     * @return 返回统一信息
     */
    @ApiOperation(value = "门店申请", notes = "门店申请")
    @PostMapping(value = "/saveShopExamine")
    @ApiImplicitParam(name = "token", value = "令牌" , paramType = "header", required = true)
    public ResultModel<?> saveShopExamine(HttpServletRequest request, @RequestBody ShopExamine shopExamine  ){
        shopExamine.setExamineStatus(3);
        shopExamine.setUserId((int)request.getAttribute(MiniAppConst.userId));
        return shopExamineService.addShopExamine(shopExamine);
    }

}
